package com.itheima.hashtable;

import java.util.HashMap;
import java.util.Hashtable;

public class Demo02 {


    public static void main(String[] args) throws InterruptedException {
        Hashtable<String, String> map = new Hashtable<>();

         new Thread(() -> {
             for (int i = 0; i < 25; i++) {
                 map.put(i+"",i+"");
             }
        }).start();
        new Thread(() -> {
            for (int i =25; i < 50; i++) {
                map.put(i+"",i+"");
            }
        }).start();

        Thread.sleep(1000);

        for (int i = 0; i < 50; i++) {
            System.out.println(map.get(i+""));
        }
  /*   map.forEach((k,v)->{
         System.out.println(k+"="+v);
     });*/


    }
}
